<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="greenplum_database_ports_and_protocols">
  <title>Greenplum Database Ports and Protocols</title>
  <shortdesc>Lists network ports and protocols used within the Greenplum cluster.</shortdesc>
  <body>
    <p>Greenplum Database clients connect with TCP to the Greenplum master instance at the client
      connection port, 5432 by default. The listen port can be reconfigured in the
        <filepath>postgresql.conf</filepath> configuration file. Client connections use the
      PostgreSQL libpq API. The <codeph>psql</codeph> command-line interface, several Greenplum
      utilities, and language-specific programming APIs all either use the libpq library directly or
      implement the libpq protocol internally. </p>
    <p>Each segment instance also has a client connection port, used solely by the master instance
      to coordinate database operations with the segments. The <codeph>gpstate -p</codeph> command,
      run on the Greenplum master, lists the port assignments for the Greenplum master and the
      primary segments and mirrors. For example:
      <codeblock>[gpadmin@mdw ~]$ gpstate -p 
20190403:02:57:04:011030 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args: -p
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 5.17.0 build commit:fc9a9d4cad8dd4037b9bc07bf837c0b958726103'
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.3.23 (Greenplum Database 5.17.0 build commit:fc9a9d4cad8dd4037b9bc07bf837c0b958726103) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC) 6.2.0, 64-bit compiled on Feb 13 2019 15:26:34'
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:--Master segment instance  /data/master/gpseg-1  port = 5432
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:--Segment instance port assignments
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-----------------------------------
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   Host   Datadir                Port
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw1   /data/primary/gpseg0   20000
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw2   /data/mirror/gpseg0    21000
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw1   /data/primary/gpseg1   20001
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw2   /data/mirror/gpseg1    21001
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw1   /data/primary/gpseg2   20002
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw2   /data/mirror/gpseg2    21002
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw2   /data/primary/gpseg3   20000
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw3   /data/mirror/gpseg3    21000
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw2   /data/primary/gpseg4   20001
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw3   /data/mirror/gpseg4    21001
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw2   /data/primary/gpseg5   20002
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw3   /data/mirror/gpseg5    21002
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw3   /data/primary/gpseg6   20000
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw1   /data/mirror/gpseg6    21000
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw3   /data/primary/gpseg7   20001
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw1   /data/mirror/gpseg7    21001
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw3   /data/primary/gpseg8   20002
20190403:02:57:05:011030 gpstate:mdw:gpadmin-[INFO]:-   sdw1   /data/mirror/gpseg8    21002
</codeblock></p>
    <p>Additional Greenplum Database network connections are created for features such as standby
      replication, segment mirroring, statistics collection, and data exchange between segments.
      Some persistent connections are established when the database starts up and other transient
      connections are created during operations such as query execution. Transient connections for
      query execution processes, data movement, and statistics collection use available ports in the
      range 1025 to 65535 with both TCP and UDP protocols. </p>
    <note>To avoid port conflicts between Greenplum Database and other applications when
      initializing Greenplum Database, do not specify Greenplum Database ports in the range
      specified by the operating system parameter <codeph>net.ipv4.ip_local_port_range</codeph>. For
      example, if <codeph>net.ipv4.ip_local_port_range = 10000 65535</codeph>, you could set the
      Greenplum Database base port numbers to values outside of that
      range:<codeblock>PORT_BASE = 6000
MIRROR_PORT_BASE = 7000</codeblock></note>
    <p>Some add-on products and services that work with Greenplum Database have additional
      networking requirements. The following table lists ports and protocols used within the
      Greenplum cluster, and includes services and applications that integrate with Greenplum
      Database.</p>
    <table frame="all" rowsep="1" colsep="1" id="table_zf3_lzz_s5">
      <title>Greenplum Database Ports and Protocols</title>
      <tgroup cols="3">
        <colspec colname="newCol1" colnum="1" colwidth="1*"/>
        <colspec colname="c1" colnum="2" colwidth="1.0*"/>
        <colspec colname="c3" colnum="3" colwidth="2.0*"/>
        <thead>
          <row>
            <entry>Service</entry>
            <entry>Protocol/Port</entry>
            <entry>Description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>Master SQL client connection</entry>
            <entry>TCP 5432, libpq</entry>
            <entry>SQL client connection port on the Greenplum master host. Supports clients using
              the PostgreSQL libpq API. Configurable.</entry>
          </row>
          <row>
            <entry>Segment SQL client connection</entry>
            <entry>varies, libpq</entry>
            <entry>The SQL client connection port for a segment instance. Each primary and mirror
              segment on a host must have a unique port. Ports are assigned when the Greenplum
              system is initialized or expanded. The <codeph>gp_segment_configuration</codeph>
              system catalog records port numbers for each primary (p) or mirror (m) segment in the
                <codeph>port</codeph> column. Run <codeph>gpstate -p</codeph> to view the ports in
              use.</entry>
          </row>
          <row>
            <entry>Segment mirroring port</entry>
            <entry>varies, libpq</entry>
            <entry>The port where a segment receives mirrored blocks from its primary. The port is
              assigned when the mirror is set up. The <codeph>gp_segment_configuration</codeph>
              system catalog records port numbers for each primary (p) or mirror (m) segment in the
                <codeph>port</codeph> column. Run <codeph>gpstate -p</codeph> to view the ports in
              use.</entry>
          </row>
          <row>
            <entry>Greenplum Database Interconnect</entry>
            <entry>UDP 1025-65535, dynamically allocated</entry>
            <entry>The Interconnect transports database tuples between Greenplum segments during
              query execution. </entry>
          </row>
          <row>
            <entry>Standby master client listener</entry>
            <entry>TCP 5432, libpq</entry>
            <entry>SQL client connection port on the standby master host. Usually the same as the
              master client connection port. Configure with the <codeph>gpinitstandby</codeph>
              utility <codeph>-P</codeph> option.</entry>
          </row>
          <row>
            <entry>Standby master replicator</entry>
            <entry>TCP 1025-65535, gpsyncmaster</entry>
            <entry>The <codeph>gpsyncmaster</codeph> process on the master host establishes a
              connection to the secondary master host to replicate the master's log to the standby
              master. </entry>
          </row>
          <row>
            <entry>Greenplum Database file load and transfer utilities: gpfdist, gpload.</entry>
            <entry>TCP 8080, HTTP<p>TCP 9000, HTTPS</p></entry>
            <entry>The gpfdist file serving utility can run on Greenplum hosts or external hosts.
              Specify the connection port with the <codeph>-p</codeph> option when starting the
              server. <p>The gpload utility runs one or more instances of gpfdist with ports or port
                ranges specified in a configuration file.</p></entry>
          </row>
          <row>
            <entry>Gpperfmon agents</entry>
            <entry>TCP 8888</entry>
            <entry>Connection port for gpperfmon agents (<codeph>gpmmon</codeph> and
                <codeph>gpsmon</codeph>) executing on Greenplum Database hosts. Configure by setting
              the <codeph>gpperfmon_port</codeph> configuration variable in
                <filepath>postgresql.conf</filepath> on master and segment hosts.</entry>
          </row>
          <row>
            <entry>Backup completion notification</entry>
            <entry>TCP 25, TCP 587, SMTP</entry>
            <entry>The <codeph>gpbackup</codeph> backup utility can optionally send email to a list
              of email addresses at completion of a backup. The SMTP service must be enabled on the
              Greenplum master host. </entry>
          </row>
          <row>
            <entry>Greenplum Database secure shell (SSH): gpssh, gpscp, gpssh-exkeys, gppkg</entry>
            <entry>TCP 22, SSH</entry>
            <entry>Many Greenplum utilities use scp and ssh to transfer files between hosts and
              manage the Greenplum system within the cluster. </entry>
          </row>
          <row>
            <entry>Greenplum Platform Extension Framework (PXF)</entry>
            <entry>TCP 5888</entry>
            <entry>The PXF Java service runs on port number 5888 on each Greenplum Database segment
              host.</entry>
          </row>
          <row otherprops="pivotal">
            <entry morerows="2">Greenplum Command Center (GPCC)</entry>
            <entry>TCP 28080, HTTP/HTTPS, WebSocket (WS), Secure WebSocket (WSS)</entry>
            <entry>The GPCC web server (<codeph>gpccws</codeph> process) runs on the Greenplum Database master
              host or standby master host. The port number is configured at installation
              time.</entry>
          </row>
          <row otherprops="pivotal">
            <entry>TCP 8899, rcp port</entry>
            <entry>A GPCC agent (<codeph>ccagent</codeph> process) on each Greenplum Database segment host connects
              to the GPCC rpc backend at port number 8899 on the GPCC web server host.</entry>
          </row>
          <row otherprops="pivotal">
            <entry>UNIX domain socket, agent</entry>
            <entry>Greenplum Database processes transmit datagrams to the GPCC agent (<codeph>ccagent</codeph>
              process) on each segment host using a UNIX domain socket.</entry>
          </row>
          <row otherprops="pivotal">
            <entry morerows="1">GPText</entry>
            <entry>TCP 2188 (base port)</entry>
            <entry>ZooKeeper client ports. ZooKeeper uses a range of ports beginning at the base port
              number. The base port number and maximum port number are set in the GPText installation 
              configuration file at installation time. The default base port number is 2188.</entry>
          </row>
          <row otherprops="pivotal">
            <entry>TCP 18983 (base port)</entry>
            <entry>GPText (Apache Solr) nodes. GPText nodes use a range of ports beginning at the base 
              port number. The base port number and maximum port number are set in the GPText installation 
              configuration file at installation time. The default base port number is 18983.</entry>
          </row>
          <row otherprops="pivotal">
            <entry morerows="3">EMC Data Domain and DD Boost</entry>
            <entry>TCP/UDP 111, NFS portmapper </entry>
            <entry>Used to assign a random port for the mountd service used by NFS and DD Boost. The
              mountd service port can be statically assigned on the Data Domain server.</entry>
          </row>
          <row otherprops="pivotal">
            <entry>TCP 2052</entry>
            <entry>Main port used by NFS mountd. This port can be set on the Data Domain system
              using the <codeph>nfs set mountd-port</codeph> command .</entry>
          </row>
          <row otherprops="pivotal">
            <entry>TCP 2049, NFS</entry>
            <entry>Main port used by NFS. This port can be configured using the <codeph>nfs set
                server-port</codeph> command on the Data Domain server. </entry>
          </row>
          <row otherprops="pivotal">
            <entry>TCP 2051, replication</entry>
            <entry>Used when replication is configured on the Data Domain system. This port can be
              configured using the <codeph>replication modify</codeph> command on the Data Domain
              server.</entry>
          </row>
          <row>
            <entry>Pgbouncer connection pooler</entry>
            <entry>TCP, libpq</entry>
            <entry>The pgbouncer connection pooler runs between libpq clients and Greenplum (or
              PostgreSQL) databases. It can be run on the Greenplum master host, but running it on a
              host outside of the Greenplum cluster is recommended. When it runs on a separate host,
              pgbouncer can act as a warm standby mechanism for the Greenplum master host, switching
              to the Greenplum standby host without requiring clients to reconfigure. Set the client
              connection port and the Greenplum master host address and port in the
                <filepath>pgbouncer.ini</filepath> configuration file. </entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </body>
</topic>
